import { request, writeLog } from "@/libs/core.js"
import { Message } from 'element-ui'
const getList = async (args) => {
	const data = await request({ url: '/api/star/travel/list', data: args, method: 'post' });
	if (data && data.code == 0) {
		return data.datas;
	}
	return false;
}

const doDelete = async (args) => {
	const data = await request({ url: '/api/star/travel/delete', data: args, method: 'post' });
	if (data && data.code == 0) {
		Message({ message: '数据删除成功', type: 'success', duration: 3 * 1000 });
		return true;
	}
	return false;
}


const doStatus = async (args) => {
	const data = await request({ url: '/api/star/travel/status', data: args, method: 'post' });
	if (data && data.code == 0) {
		Message({ message: '状态修改成功', type: 'success', duration: 3 * 1000 });
		return true;
	}
	return false;
}
const doUpdate = async (args) => {
	const data = await request({ url: '/api/star/travel/update', data: args, method: 'post' });
	if (data && data.code == 0) {
		Message({ message: '编辑成功', type: 'success', duration: 3 * 1000 });
		return true;
	}
	return false;
}

export default {
	getList, doDelete, doStatus ,doUpdate
};
